<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
    <!--1.引入外部的vue.js-->
    <script src="./js/vue@3.3.4.global.js"></script>

</head>
<body>
    <!--2.view-->
    <div id="app">
        <ul>
            <li v-for="stu in stus" :key="stu.id">
                --{{stu.id}}--{{stu.name}}--{{stu.age}}
            </li>
            <hr>
            <hr>
            <!--index:元素的索引，从0开始的-->
            <li v-for="(stu,index) in stus" :key="index">
                {{index}}--{{stu.id}}--{{stu.name}}--{{stu.age}}
            </li>
        </ul>
    </div>
</body>
<!--3.view-model-->
<script>
    const app = Vue.createApp({
        /*model*/
       data(){
           return{
             stus:[
                 {id:1001,name:'jack',age:18},
                 {id:1002,name:'rose',age:17},
                 {id:1003,name:'tom',age:20},
             ]
           }
       }
    });
    /*4.挂载*/
    app.mount('#app');
</script>
</html>